package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.service.MemberOrdersService;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.dto.NursingProjectDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 服务项相关接口
 *
 * @Author mr.li
 * @Date 2025/7/31 19:54
 */
@RestController
@RequestMapping("/member/orders")
@Api(tags =  "服务项相关接口")
public class MemberOrdersController   extends BaseController {
    @Autowired
    private MemberOrdersService memberOrdersService;



    /**
     * 分页查询护理项目列表
     *
     * @param nursingProjectDto
     * @return
     */
    @GetMapping("/project/page")
    @ApiOperation("分页查询护理项目列表")
    public TableDataInfo<NursingProject> list(NursingProjectDto nursingProjectDto) {
        TableDataInfo<NursingProject> list = memberOrdersService.list(nursingProjectDto);
        list.setCode(200);
        list.setMsg("返回成功");
        return list;


    }

    @GetMapping("/project/{id}")
    @ApiOperation("根据编号查询护理项目信息")
    public AjaxResult memberProjectById(@PathVariable Integer id) {
        NursingProject   nursingProject= memberOrdersService.memberProjectById(id);

        return success(nursingProject);


    }

}
